﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Data_Access_Layer;

namespace Moje_Finanse
{
    public partial class DodajKategorie : Form
    {
        public DodajKategorie()
        {
            InitializeComponent();
        }

        private void buttonDodajKat_Click(object sender, EventArgs e)
        {
            try
            {
                Categories category = new Categories
                {
                    Id = System.Guid.NewGuid(),
                    Category = textBoxNazwa.Text.Trim()
                };

                DbManager.Instance.AddCategory(category);
            }
            catch (Exception)
            {
                throw;
            }
            this.Close();
        }
    }
}
